﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
namespace AdonetUsing
{
    class Program
    {
        static void Main(string[] args)
        {
           
            var comString = "server=.;database=Admin3000;uid=sa;pwd=lz20001130";
            SqlConnection sqlConnection = new SqlConnection(comString);
            sqlConnection.Open();
            var conString = "select * from Users";
            SqlCommand sqlCommand = new SqlCommand(conString,sqlConnection);
            
            var sdr= sqlCommand.ExecuteReader();
            Console.WriteLine("{0}/t{1}/t{2}/t{3}","id", "Username", "Password", "CreatedTime");
            while (sdr.Read())
            {
                Console.WriteLine("{0}/t{1}/t{2}/t{3}", sdr["id"], sdr["Username"], sdr["Password"],sdr[ "CreatedTime"]);

                
            }
            sqlConnection.Close();

        }
    }
}
